import React, { Component } from 'react'
import axios from 'axios';

export default class App extends Component {
    loadData = () => {
        axios.get('http://localhost:3000/api1/students').then((res) => { 
            console.log('结果',res.data);
         })
    }
    loadCarData = () => {
      axios.get('http://localhost:3000/api2/cars').then((res) => { 
        console.log('结果',res.data);
       })
    }
  render() {
    return (
      <div>
        <button onClick={this.loadData}>点我获取数据</button>
        <button onClick={this.loadCarData}>点我获取车辆数据</button>
      </div>
    )
  }
}
